home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1995 May / PC Answers CD-ROM 7 (Future Publishing) (May 1995).iso / vbits / code / cert / trk3_eg / dde_src / form1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-10-07  |  2.2 KB  |  87 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   4020
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1485
  7.    ClientWidth     =   7365
  8.    Height          =   4425
  9.    Left            =   1035
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   4020
  12.    ScaleWidth      =   7365
  13.    Top             =   1140
  14.    Width           =   7485
  15.    Begin CommandButton cmdClose 
  16.       Caption         =   "&Close DDE"
  17.       Height          =   735
  18.       Left            =   600
  19.       TabIndex        =   4
  20.       Top             =   1440
  21.       Width           =   2295
  22.    End
  23.    Begin CommandButton Command3 
  24.       Caption         =   "&Poke Close"
  25.       Height          =   495
  26.       Left            =   2280
  27.       TabIndex        =   3
  28.       Top             =   2400
  29.       Width           =   1215
  30.    End
  31.    Begin TextBox txtDestination 
  32.       Height          =   285
  33.       Left            =   480
  34.       TabIndex        =   2
  35.       Text            =   "Text1"
  36.       Top             =   720
  37.       Width           =   1575
  38.    End
  39.    Begin CommandButton Command2 
  40.       Caption         =   "&Request"
  41.       Height          =   495
  42.       Left            =   3000
  43.       TabIndex        =   1
  44.       Top             =   240
  45.       Width           =   1215
  46.    End
  47.    Begin CommandButton Command1 
  48.       Caption         =   "&Open Source"
  49.       Height          =   495
  50.       Left            =   3000
  51.       TabIndex        =   0
  52.       Top             =   1320
  53.       Width           =   1215
  54.    End
  55. Option Explicit
  56. Sub cmdClose_Click ()
  57. txtDestination.LinkMode = 0
  58. End Sub
  59. Sub Command1_Click ()
  60. Dim rc
  61. Dim Sourcepath As String
  62. Sourcepath = App.Path
  63. If Right$(Sourcepath, 1) <> "\" Then
  64.     Sourcepath = Sourcepath & "\"
  65. End If
  66. rc = Shell(Sourcepath & "source")
  67. End Sub
  68. Sub Command2_Click ()
  69. On Error GoTo ErrDDE
  70. txtDestination.LinkMode = 0
  71. txtDestination.LinkTopic = "Source|frmSource"
  72. txtDestination.LinkItem = "txtItem"
  73. txtDestination.LinkMode = 2
  74. txtDestination.LinkRequest
  75. Exit Sub
  76. ErrDDE:
  77. If Err = 282 Then
  78.     MsgBox "Source is not there"
  79.     MsgBox Str$(Err)
  80. End If
  81. Exit Sub
  82. End Sub
  83. Sub Command3_Click ()
  84. txtDestination.Text = "close"
  85. txtDestination.LinkPoke
  86. End Sub
  87.